import { Controller, Get, HttpCode, UseGuards } from '@nestjs/common';
import { ApiQuery, ApiTags } from '@nestjs/swagger';
import { RolesGuard } from 'src/Guards/roles.guard';
import { Roles } from 'src/roles/roles.decorator';
import { RoleGuardsService } from './role-guards.service';

@Controller('role-guards')
@UseGuards(RolesGuard)
@ApiTags("Role")
export class RoleGuardsController {
    constructor(private roleGuards: RoleGuardsService) {

    }
    @Get('user')
    @Roles('admin')
    @ApiQuery({ name: 'role', required: true })
    @HttpCode(200)
    getAdmin() {
        return this.roleGuards.getAdminRole()
    }

}
